package com.hsck.order.kds.setup.adapter

import android.view.View
import androidx.annotation.LayoutRes
import com.hsck.order.kds.base.bean.CategoryBean
import com.hsck.order.kds.base.common.BaseAdapter
import com.hsck.order.kds.base.common.BaseViewHolder
import kotlinx.android.synthetic.main.item_food.view.*

/**
 * 沽清菜品-适配器
 */
class FoodAdapter(@LayoutRes layoutId: Int) : BaseAdapter<CategoryBean>(layoutId) {

    override fun onBindViewHolder(holder: BaseViewHolder, data: CategoryBean) {

        if (holder.adapterPosition%3 ==0){
            holder.itemView.view_item_food.visibility= View.VISIBLE
            holder.itemView.tv_item_food_soldOutFlag.visibility= View.VISIBLE
        }else{
            holder.itemView.view_item_food.visibility= View.GONE
            holder.itemView.tv_item_food_soldOutFlag.visibility= View.GONE
        }
        holder.itemView.tv_item_food_name.text = "老成都${data.tagName}"

    }

}